package com.resign.carl.simplefactory;

import com.resign.carl.simplefactory.enumeration.PizzaType;
import com.resign.carl.simplefactory.pizza.CheesePizza;
import com.resign.carl.simplefactory.pizza.ClamPizza;
import com.resign.carl.simplefactory.pizza.PepperoniPizza;
import com.resign.carl.simplefactory.pizza.VeggiePizza;

/**
 * Created by carl.zhao on 2016/6/14.
 */
public class SimplePizzaFactory {

    private SimplePizzaFactory(){

    }

    public static Pizza createPizza(PizzaType pizzaType){
        if(pizzaType.equals(PizzaType.CHEESE)){
            return new CheesePizza();
        }
        if(pizzaType.equals(PizzaType.CLAM)){
            return new ClamPizza();
        }
        if(pizzaType.equals(PizzaType.PEPPERONI)){
            return new PepperoniPizza();
        }
        if(pizzaType.equals(PizzaType.VEGGIE)){
            return new VeggiePizza();
        }
        return null;
    }

}
